<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body{
  margin: 6px;
  padding: 0;
  font-size: 12px;
  font-family: tahoma, arial;
  background: #fff;
}

table{
  width: 100%;
}
tr.odd{
  background: #fff;
 }
 tr.even{
  background: #eee;
}

div.datagrid_div{
 width: 100%;
 border: 1px solid #999;
}

/*****************样式1*******************/
 table.datagrid1{
  border-collapse: collapse;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 th{
  color: #333;
  padding: 3px;
  font-family: monospace;
  background: #9cf;
  text-align: center;
  border-top: 1px solid #666;
  border-bottom: 1px solid #666;
 }
 table.datagrid1 td{
  padding: 3px;
  border-top: 1px solid #ccc;
 }

 tr:hover,
 tr.hover{
  background: #9cf;
 }

 </style>

 <script type="text/javascript">
  function add_event(tr){
   tr.onmouseover = function(){
    tr.className += ' hover';
   };
   tr.onmouseout = function(){
    tr.className = tr.className.replace(' hover', '');
   };
  }

  function stripe(table) {
   var trs = table.getElementsByTagName("tr");
   for(var i=1; i<trs.length; i++){
    var tr = trs[i];
    tr.className = i%2 != 0? 'odd' : 'even';
    add_event(tr);
   }
  }

  window.onload = function(){
   var tables = document.getElementsByTagName('table');
   for(var i=0; i<tables.length; i++){
    var table = tables[i];
    table.className="datagrid1";
    stripe(tables[i]);
   }
  }  
 </script>
<title>学生信息列表</title>
</head>
<body>
<div><b>您现在的位置是：考生管理 &gt;&gt;考生信息管理</b><button style="float: right;" onclick = "location.href='student.action?action=gotoadd'" >添加考生</button></div>
<div style="margin: 0.3em;">
<form action="student.action" method="post" >
	<input type="hidden" name="action" value="search" />
	学生姓名：<input type="text" name="name"/> <input type="submit" value="查询" onclick="document.getElementsByTagName('jsp:include').page='../../commons/Pagelist1.jsp'" />
	<a href="student.action?action=list" onclick="document.getElementsByTagName('jsp:include').page='../../commons/Pagelist.jsp'" >全部学生信息</a> 
</form>
</div>
<table cellspacing="1" border="1" >
	<tr style="height:25px;" >
		<th >考生编号</th>
		<th >考试号</th>
		<th >考生姓名</th>
		<th >手机</th>
		<th >操作</th>
	</tr>
	<s:if test="%{stuList.size()!=0}">
		<s:iterator value="%{stuList}" id="stu" status="status">
	<tr align="center">
		<td align="center">&nbsp;<s:property value="#status.count"/></td>
		<td>&nbsp;<s:property value="#stu.studentNo"/></td>
		<td align="center">&nbsp;<s:property value="#stu.name"/></td>
		<td align="center">&nbsp;<s:property value="#stu.mobilePhone"/></td>
		<td>
		<a style="cursor: pointer;" onclick="location.href='student.action?action=edit&id=<s:property value="#stu.id"/>'">
		<img alt="编辑" src="../../images/modify1.gif"/>
		</a>
		&nbsp;&nbsp;
		<a style="cursor: pointer;" onclick="location.href='student.action?action=del&id=<s:property value="#stu.id"/>'">
		<img alt="删除" src="../../images/delete1.gif"/></a>
		</td>
		</tr>
		</s:iterator>
	</s:if>
	<s:else>
	<tr>
		<td align="center" width="100%" colspan="5">
			无任何考生信息！
		</td>
	</tr>
	</s:else>
</table>
<br/>
<div id="page">
	<jsp:include page="../../commons/Pagelist.jsp" />
</div>
</body>
</html>